import request from './request'

export function getUsers(params) {
  return request.get('/users', { params })
}

export function getUserById(userId) {
  return request.get(`/users/${userId}`)
}

export function getUserByUsername(username) {
  return request.get(`/users/by-username/${encodeURIComponent(username)}`)
}

export function getUserByEmail(email) {
  return request.get(`/users/by-email/${encodeURIComponent(email)}`)
}

export function createUser(data) {
  return request.post('/users', data)
}

export function updateUser(userId, data) {
  return request.put(`/users/${userId}`, data)
}

export function deleteUser(userId) {
  return request.delete(`/users/${userId}`)
}


